package work;

import java.util.Scanner;

public class Calculator {
    double num;
    double num1;
    int sum;
    public void Show() {

        switch(sum) {
            case 1:
                System.out.println("加法："+(num+num1));
                break;
            case 2:
                System.out.println("减法："+(num-num1));
                break;
            case 3:
                System.out.println("乘法："+(num*num1));
                break;
            case 4:
                System.out.println("除法："+(num/num1));
                break;
        }
    }
    public static void main(String[] args) {
        Calculator ceter = new Calculator();
        Scanner input = new Scanner(System.in);
        System.out.print("请输入第一个整数：");
        ceter.num = input.nextInt();
        System.out.print("请输入第二个整数：");
        ceter.num1 = input.nextInt();
        System.out.print("请输入算法：1.加，2.减，3.乘，4.除");
        ceter.sum = input.nextInt();
        ceter.Show();
    }
}
